package com.sc.VenusQueryBeta.api.login;

import com.hengjun.kingstar.sdk.helper.okhttp.ResponseFormat;
import com.sc.VenusQueryBeta.model.bean.login.ChangePwdBean;
import com.sc.VenusQueryBeta.model.bean.login.ComfirmRegistrationBean;
import com.sc.VenusQueryBeta.model.bean.login.EquipmentLoginBean;
import com.sc.VenusQueryBeta.model.bean.login.FirstLoginSubmintBean;
import com.sc.VenusQueryBeta.model.bean.login.QueryRegisBean;
import com.sc.VenusQueryBeta.model.bean.login.RegistBean;
import com.sc.VenusQueryBeta.model.bean.login.RegisterVerticationBean;
import com.sc.VenusQueryBeta.model.bean.login.UsersLoginBean;

import io.reactivex.Observable;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.POST;

/**
 * Created by Administrator on 2018/11/10.
 */

public interface LoginApi {
    //用户登录
    @FormUrlEncoded
    @POST("httpUserMessage/SmsClient-smsClientLogin.action")
    @ResponseFormat("json")
    Observable<UsersLoginBean> getUsersLogin(@Field("id")String id, @Field("password")String password, @Field("smsCode")String smsCode, @Field("deviceUID")String deviceUID,
                                             @Field("token")String token);

    //获取验证码
    @FormUrlEncoded
    @POST("httpUserMessage/SmsClient-sendRegisterAppNumber.action")
    @ResponseFormat("json")
    Observable<RegisterVerticationBean> getRegisterNumber(@Field("clientUID") String clientUID, @Field("deviceUID") String deviceUID, @Field("deviceType") String deviceType,
                                                          @Field("registerSmsnum") String registerSmsnum, @Field("areaCode") String areaCode, @Field("flag") String flag);

    //直接注册请求
    @FormUrlEncoded
    @POST("httpUserMessage/SmsClient-requestAddUserRegister.action")
    @ResponseFormat("json")
    Observable<RegistBean> regist(@Field("id") String id, @Field("smsCode") String smsCode, @Field("password") String password, @Field("clientUID") String clientUID,
                                  @Field("deviceUID") String deviceUID, @Field("deviceType") String deviceType, @Field("areaCode") String areaCode);

    //通过伺服器确认注册
    @FormUrlEncoded
    @POST("httpUserMessage/SmsClient-addRegistDevice.action")
    @ResponseFormat("json")
    Observable<ComfirmRegistrationBean> getComfirmRegistration(@Field("id")String id, @Field("smsCode")String smsCode, @Field("password")String password, @Field("clientUID")String clientUID,
                                                               @Field("deviceUID")String deviceUID, @Field("deviceType")String deviceType);

    //查詢註冊服務器
    @FormUrlEncoded
    @POST("httpUserMessage/SmsClient-queryRegisterServerSetting2.action")
    @ResponseFormat("json")
    Observable<QueryRegisBean> queryRegist(@Field("id")String id);

    //忘記密碼
    @FormUrlEncoded
    @POST("httpUserMessage/SmsClient-updateNewUserPasswordById.action")
    @ResponseFormat("json")
    Observable<ChangePwdBean> ChnagePwd(@Field("id")String id, @Field("newPassword")String newPassword);

    //第一次登陆设备，获取验证码
    @FormUrlEncoded
    @POST("httpUserMessage/SmsClient-sendRegistrationCode.action")
    @ResponseFormat("json")
    Observable<EquipmentLoginBean> EpLogin(@Field("clientUID")String clientUID, @Field("deviceUID")String deviceUID, @Field("deviceType")String deviceType,
                                           @Field("registerSmsnum")String registerSmsnum);

    // 第一次登录的页面确定后继续掉通过伺服器确认注册
    @FormUrlEncoded
    @POST("httpUserMessage/SmsClient-addRegistDevice.action")
    @ResponseFormat("json")
    Observable<FirstLoginSubmintBean> firstsubmint(@Field("id")String id, @Field("smsCode")String smsCode, @Field("password")String password, @Field("clientUID")String clientUID,
                                                   @Field("deviceUID")String deviceUID, @Field("deviceType")String deviceType);
}
